From: Ian Campbell Date: Thu, 5 Apr 2007 14:38:09 +0000 (+0100) Subject: LINUX: PVonHVM: Fixes to build with kernels back to 2.6.5. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15264^2~6^2 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:///%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22man:/?a=commitdiff_plain;h=93d1b5695a55cfc6085deb7ceef4685a6cc9d6fb;p=xen.git LINUX: PVonHVM: Fixes to build with kernels back to 2.6.5. Signed-off-by: Ian Campbell --- diff --git a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c index 158c3b10cd..932e2079d7 100644 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c @@ -59,6 +59,10 @@ #include #include "common.h" +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include +#endif + #ifdef CONFIG_PROC_FS static struct proc_dir_entry *balloon_pde; #endif diff --git a/linux-2.6-xen-sparse/drivers/xen/balloon/sysfs.c b/linux-2.6-xen-sparse/drivers/xen/balloon/sysfs.c index 463a9f7e3b..6079232364 100644 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/sysfs.c +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/sysfs.c @@ -31,9 +31,14 @@ #include #include #include +#include #include #include "common.h" +#ifdef HAVE_XEN_PLATFORM_COMPAT_H +#include +#endif + #define BALLOON_CLASS_NAME "memory" #define BALLOON_SHOW(name, format, args...) \ diff --git a/linux-2.6-xen-sparse/drivers/xen/fbfront/xenfb.c b/linux-2.6-xen-sparse/drivers/xen/fbfront/xenfb.c index 0d7d4ca700..712c928912 100644 --- a/linux-2.6-xen-sparse/drivers/xen/fbfront/xenfb.c +++ b/linux-2.6-xen-sparse/drivers/xen/fbfront/xenfb.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h index d327d703ea..f6a9371034 100644 --- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h +++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h @@ -40,7 +40,7 @@ /* Some kernels have this typedef backported so we cannot reliably * detect based on version number, hence we forcibly #define it. */ -#if defined(__LINUX_TYPES_H) || defined(__LINUX_GFP_H) +#if defined(__LINUX_TYPES_H) || defined(__LINUX_GFP_H) || defined(_LINUX_KERNEL_H) #define gfp_t unsigned #endif @@ -51,6 +51,14 @@ #define atomic_notifier_call_chain(chain,val,v) notifier_call_chain(chain,val,v) #endif +#if defined(_LINUX_MM_H) && defined set_page_count +#define init_page_count(page) set_page_count(page, 1) +#endif + +#if defined(__LINUX_GFP_H) && !defined __GFP_NOMEMALLOC +#define __GFP_NOMEMALLOC 0 +#endif + #if defined(_LINUX_FS_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) #define nonseekable_open(inode, filp) /* Nothing to do */ #endif @@ -75,6 +83,10 @@ void *kzalloc(size_t size, int flags); #define end_that_request_last(req, uptodate) end_that_request_last(req) #endif +#if defined(_LINUX_CAPABILITY_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16) +#define capable(cap) (1) +#endif + #if defined(_LINUX_KERNEL_H) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) extern char *kasprintf(gfp_t gfp, const char *fmt, ...) __attribute__ ((format (printf, 2, 3)));